<template>
  <div class="dy-main ExchangeTradeDetail">
    <div class="dy-header">
      <x-header :right-options="{showMore: false}" :left-options="{preventGoBack:true}" @on-click-back="back" @on-click-more="showMenus = true">交易详情
      </x-header>
    </div>
    <div class="dy-body">
      <div class="main">
        <div>
          <div>业务编号</div>
          <div>{{ financialData.businessNo }}</div>
        </div>
        <div>
          <div>币种</div>
          <div>{{ financialData.currancyType }}</div>
        </div>
        <div>
          <div>购汇金额</div>
          <div>{{ financialData.BuyAmt }}</div>
        </div>
        <div>
          <div>购汇账户</div>
          <div>{{ financialData.BuyAccno }}</div>
        </div>
        <div>
          <div>实际成交汇率</div>
          <div>{{ financialData.realBuyRate }}</div>
        </div>
        <div>
          <div>换算成人民币</div>
          <div>{{ financialData.changeRate }}</div>
        </div>
        <div>
          <div>购汇资金属性</div>
          <div>{{ financialData.buyProperty }}</div>
        </div>
        <div>
          <div>申请日期</div>
          <div>{{ financialData.applyDate }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      financialData: {
        businessNo: '6210 0884 7643 047',
        currancyType: '美元',
        BuyAmt: '300.00',
        BuyAccno: '6225********3453',
        realBuyRate: '6.654',
        changeRate: '8,000.00',
        buyProperty: '旅游',
        applyDate: '2017/09/22'
      },
      status: ''
    }
  },
  methods: {
    back () {
      this.$publicFun.goBack(this)
    },
    goNext (a) {
      alert(a)
    },
    refreshOption () {
      let LVm = this
      this.$bridge.callhandler('nativeRequest',
        JSON.stringify({
          'requstSource': 'internetRequest',
          'url': 'http://whichat.icitic.net/mstep/mstep.do?act=business',
          'params': {'method_Name': 'showProDetail', 'basic_Data': {'productId': '3015'}}
        }),
        function (response) {
          response = JSON.parse(response)
          if (response.status === 0 || response.status === '0') {
            LVm.financialData = response.data.data[0]
            LVm.status = response.status
          } else {
            console.log('fail')
          }
        }
      )
    }
  },
  created () {
    this.refreshOption()
  }
}
</script>

<style lang="less">
.ExchangeTradeDetail{
  .dy-body{
    &{
      padding-top: .91rem;
    }
    .main{
      background-color: #FFFFFF;
      >div{
        font-size: .28rem;
        height: .88rem;
        line-height: .88rem;
        display: flex;
        border-top: 1px solid #EAEAEA;
        margin-left: .3rem;
        padding-right: .3rem;
        &:nth-of-type(1){
          margin-left: 0;
          padding-left: .3rem;
        }
        >div{
          flex: 1;
        }
        >div:nth-of-type(1){
          color: #333333;
        }
        >div:nth-of-type(2){
          text-align: right;
          color: #999999;
        }
      }
    }
  }
}
</style>
